package com.ssy.lingxi.pay.api.common.allInPay;

import com.ssy.lingxi.common.language.LanguageHolder;

/**
 * 通联用户状态
 *
 * @author lqa
 * @version 2.0.0
 * @date 2021/12/2
 */
public enum AllInPayPersonalStateEnum {
    EFFECTIVE(1, "有效", "整型"),
    AUDIT_FAILURE(3, "审核失败", "整型"),
    LOCKED(5, "已锁", "整型"),
    PENDING_REVIEW(7, "待审核", "整型");
    private Integer code;
    private String type;

    AllInPayPersonalStateEnum(Integer code, String name, String type) {
        this.code = code;
        this.type = type;
    }

    public static String getName(Integer code) {
        AllInPayPersonalStateEnum[] values = AllInPayPersonalStateEnum.values();
        for (AllInPayPersonalStateEnum allInPayPersonalStateEnum : values) {
            if (allInPayPersonalStateEnum.code.equals(code)) {
                String key = AllInPayPersonalStateEnum.class.getSimpleName().concat(".");
                return LanguageHolder.getName(key.concat(String.valueOf(code)));
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
